package com.bw.conf;

import com.bw.conf.interceptor.LoginInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebConfig implements WebMvcConfigurer {

    @Autowired
    private LoginInterceptor loginInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(loginInterceptor)
                .excludePathPatterns("/user/login")
                .excludePathPatterns("/user/download/*")
                .excludePathPatterns("/orderpic/showPhoto/*/*")//图片的回显
                .excludePathPatterns("/orderpic/importPhotos")//图片的上传
                .excludePathPatterns("/orderitem/importExcel")//导入零件
                .excludePathPatterns("/link/exportExcel")//导出联系人不拦截
                .excludePathPatterns("/pro/imporExcel")//上传文件不拦截
                .excludePathPatterns("/mater/exportExcel")//导出路径不拦截
                .excludePathPatterns("/pro/exportExcel")//导出路径不拦截
                .excludePathPatterns("/link/imporExcel")//导入联系人不拦截
                .excludePathPatterns("/mater/exportExcel")//原材料导出路径不拦截
                .excludePathPatterns("/mater/imporExcel")//原材料上传文件不拦截
                .excludePathPatterns("/pro/imporExcel")//工序上传文件不拦截
                .excludePathPatterns("/pro/exportExcel")//工序导出路径不拦截
                .excludePathPatterns("/customer/imporExcel")//上传文件不拦截
                .excludePathPatterns("/customer/exportExcle")//导出客户不拦截
                .excludePathPatterns("/order/imporExcel")//上传文件不拦截
                .excludePathPatterns("/customer/sendYZM/{tel}")//客户发送验证码不拦截
                .excludePathPatterns("/customer/clogin")//客户登录不拦截
                .excludePathPatterns("/order/imporExcel")//上传文件不拦截
                .excludePathPatterns("/order/exportExcel/{id}");//文件导出不拦截
    }


}